Manages the depth and stencil states available in the component. More...
Public Member Functions | |
~DepthStencilStateManager () | |
DepthStencilState * | createOrRetrieve (const std::string_view &name) |
DepthStencilState * | get (const std::string_view &name) |
DepthStencilState * | getByIndex (unsigned int index) |
void | rename (const std::string_view &oldName, const std::string_view &newName) |
void | erase (const std::string_view &name) |
DepthStencilState * | getDefaultState () const |
Manages the depth and stencil states available in the component.
The manager owns the memory it allocates. External code should never free memory returned.
nkGraphics::DepthStencilStateManager::~DepthStencilStateManager | ( | ) |
Destructor.
DepthStencilState* nkGraphics::DepthStencilStateManager::createOrRetrieve | ( | const std::string_view & | name | ) |
Creates if unavailable, or retrieves if available, a state.
name | The name of the state to retrieve. |
DepthStencilState* nkGraphics::DepthStencilStateManager::get | ( | const std::string_view & | name | ) |
Retrieves a state.
name | The name of the state to retrieve. |
DepthStencilState* nkGraphics::DepthStencilStateManager::getByIndex | ( | unsigned int | index | ) |
Retrieves a state by index. Note that an index can map to different states as the internal memory is changed. Mainly used for looping over all states in one go.
index | The index of the state to retrieve. |
void nkGraphics::DepthStencilStateManager::rename | ( | const std::string_view & | oldName, |
const std::string_view & | newName | ||
) |
Renames a state, changing both its name and the way to address it in the manager.
oldName | The name of the state to rename. |
newName | The new name to attach to it. |
void nkGraphics::DepthStencilStateManager::erase | ( | const std::string_view & | name | ) |
Erases and frees the memory allocated for a state.
name | The name of the state to erase. |
DepthStencilState* nkGraphics::DepthStencilStateManager::getDefaultState | ( | ) | const |